package cmd

import (
	"fmt"

	"github.com/spf13/cobra"
)

var (
	output   string
	database string
)

var genModelCmd = &cobra.Command{
	Use:   "genModel",
	Short: "",
	Long:  ``,
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("--- GenModel 运行 ---")
		fmt.Println(len(args))

		runGen(args)
	},
}

func init() {
	rootCmd.AddCommand(genModelCmd)

	genModelCmd.Flags().StringVarP(&output, "output", "o", "", "output file")
	genModelCmd.Flags().StringVarP(&database, "database", "d", "", "database select")
}

func runGen(args []string) {
	for k, v := range args {
		fmt.Println(k)
		fmt.Println(v)
	}

	fmt.Println(database)
	fmt.Println(output)
}
